<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>Wireframe</title>
		<link rel="stylesheet" href="<?php echo site_url("/jqueryui/css/ui-lightness/jquery-ui-1.8.18.custom.css"); ?>" type="text/css">
		<link rel="stylesheet" href="<?php echo site_url("/bootstrap/css/bootstrap.css"); ?>" type="text/css">
		<script type="text/javascript" language="javascript" src="<?php echo site_url("/jquery/jquery-1.7.1.min.js"); ?>"></script>
		<script type="text/javascript" language="javascript" src="<?php echo site_url("/jqueryui/js/jquery-ui-1.8.18.custom.min.js"); ?>"></script>
		<script type="text/javascript" language="javascript" src="<?php echo site_url("/jquery/jquery.validate.min.js"); ?>"></script>
		<script type="text/javascript" language="javascript" src="<?php echo site_url("/bootstrap/js/bootstrap.js"); ?>"></script>
		<script type="text/javascript" charset="utf-8">
			$(document).ready(function()
			{
				$("#userProfileForm").validate();
				$("#date").datepicker();
			});
		</script>
	</head>
	<body>
		<?php $this->load->view('v_navbar'); ?>
		<div class="container">
			<div class="row">
				<div class="span12 ui-corner-all">
					<div class="well">
						<h1>Notifications</h1>
						<br/>
						<table border='1'>
						<tr>
							<th></th>
							<th>Occurance</th>
							<th>Next Date</th>
							<th>Message</th>
						</tr>
						<?php
							foreach($notifications as $notification)
							{
								echo '<tr>';
								echo '<td><a class="btn" href="' . site_url('notifications/removenotification/' . $notification->notificationID) . '">Delete</a></td>';
								echo '<td>' . $notification->occurance . '</td>';
								echo '<td>' . substr($notification->nextSendDate, 0, 10) . '</td>';
								echo '<td>' . substr($notification->message, 0, 30) . '...</td>';
								echo '</tr>';
							}
						?>
						</table>
						<form name="input" id="notificationForm" action=<?php echo site_url("notifications/addnotification/"); ?> method="post">
						<input type="text" name="userId" id="userId" style="display:none;" value="<?php echo $userId; ?>" />
						<label for="date">Date:</label>
						<input type="text" name="date" id="date" class="required" value="<?php echo date('m/d/Y');?>" minlength="2" />
						<label for="date">Occurance</label>
						<select name="occurance" id="occurance">
							<option value="onetime">One Time</option>
							<option value="weekly">Weekly</option>
							<option value="monthly">Monthly</option>
							<option value="annually">Annually</option>
						</select>
						<div><textarea type="text" name="message" id="message" class="required" minlength="2" />A simple reminder</textarea></div>
						<input type="submit" value="Save Changes" />
						<a href="<?php echo site_url('notifications') ?>"><input type='submit' value='Cancel' /></a>
						</form>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>